package procon;

import redis.clients.jedis.Jedis;

/**
 * Created by li on 2016/4/16.
 */
public class Consumer {
    private Jedis jedis;

    public Consumer(Jedis jedis){
        this.jedis=jedis;
    }

    public String consume(String key){
        String value = jedis.rpop(key);
        if (value == null) {
            value="对不起，已经抢完了";
        }
        return value;
    }
}
